set -e
set -o pipefail
if [ -z "${LOCATION}" ]; then LOCATION=""; fi
if [ -z "${ORDINAL}" ]; then ORDINAL=10000; fi

for d in $DIRS; do if [ -d $d ]; then data_dir=$d; else data_dir=${d/\/home\/$(whoami)\/work\/curves/\/mnt\/${LOCATION}\/capture}; fi && echo ${data_dir} && grep --color --text --only-matching -e '\(\(\@Sens. DeflSens: V\)\|\(\Spring Constant:\)\|\(InvOLS:\)\|\(SpringC:\)\)[ 0-9.e-]*' $(find ${data_dir} -type f | head -n ${ORDINAL} | tail -n 1); done
